package morphia.spring;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * {@link com.google.code.morphia.Datastore} injector.<br/>
 * Usage:<div style="color:#515151">
 * &nbsp;&nbsp;&nbsp;&nbsp;&#64;DBDef(name = &quot;cloudDB&quot;, host = "host.cloud.com", port = 27847, databaseName = &quot;dbName&quot;, username = &quot;username&quot;, password = &quot;password&quot;)<br/>
    &nbsp;&nbsp;&nbsp;&nbsp;private {@link DbDefinition} dbdef;<br/><br/>
 * &nbsp;&nbsp;&nbsp;&nbsp;&#64;DatastoreDef(&quot;cloudDB&quot;)<br/>
    &nbsp;&nbsp;&nbsp;&nbsp;private {@link com.google.code.morphia.Datastore} stockStore;
 * </div>
 * @author Kent Yeh
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.METHOD})
@Documented
@Inherited
public @interface DatastoreDef {

    /**
     * {@link DBDef}'s bean name.
     */
    String value();

    /**
     * invoke {@link com.google.code.morphia.dao.DAO#getDatastore() }&#46;{@link com.google.code.morphia.Datastore#ensureCaps() ensureCaps() } after generated.
     * @return 
     */
    boolean ensureCaps() default false;
}
